package com.spdd.mt.common.base;


import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * 自定义异常类(继承RuntimeException)
 * <p>
 * 2021年5月14日14:30:26
 */
public class BaseException extends RuntimeException implements Serializable {

    private static final long serialVersionUID = 1L;

    @Getter
    @Setter
    protected String message;

    @Getter
    @Setter
    protected String status = "500";

    public BaseException() {

    }

    public BaseException(String message) {
        super(message);
        this.message = message;
    }

    public BaseException(String message, Throwable cause) {
        super(message, cause);
        this.message = message;
    }

    public BaseException(Status status) {
        super(status.message());
        this.status = status.status();
    }

    public BaseException(String status, String message) {
        super(message);
        this.message = message;
        this.status = status;
    }

    public BaseException(String status, String message, Throwable cause) {
        super(message, cause);
        this.status = status;
        this.message = message;
    }


}
